package models.shop;

import play.db.jpa.GenericModel;

import javax.persistence.*;

@Entity
@Table(name = "category_images")
public class CategoryImageRecord extends GenericModel{
    @Id
    public int categoryId;
    @Id
    public int imageId;

    @OneToOne(optional = true, fetch = FetchType.EAGER)
    @JoinColumn(name = "imageId")
    public Image image;
    @OneToOne(optional = true, fetch = FetchType.EAGER)
    @JoinColumn(name = "categoryId")
    public Category category;
}
